<%@ page language="java" pageEncoding="utf-8"%>
<%@taglib prefix="s" uri="/struts-tags"%>
${aier_doctype}
<html <s:property value="aier_html_xmlns" escape="false"/>>
<head>
<meta http-equiv="Content-Type" content="${aier_content_type}" />
<meta name="keywords" content="${aier_keyworks}" />
<meta name="description" content="${aier_description}" />
<title>${aier_title}</title>
<link rel="stylesheet" href="${aier_css_url}${aier_jqui_css}ui.css" />
<link rel="Stylesheet" href="${aier_css_url}jq/jq.css" />
<link rel="stylesheet" href="${aier_css_url}jp/msg.css" />
<link rel="stylesheet" href="${aier_css_url}social/module/reset.css" />
<link rel="stylesheet" href="${aier_css_url}social/classes/common.css" />
<link rel="stylesheet" href="${aier_css_url}social/classes/cmanage.css" />

<script type="text/javascript" src="${aier_js_url}j.js"></script>
<script type="text/javascript" src="${aier_js_url}b.js"></script>
<script type="text/javascript" src="${aier_js_url}jp/hh/ui.js"></script>
<script type="text/javascript" src="${aier_js_url}jp/msg.js"></script>
<script type="text/javascript" src="${aier_js_url}97/WdatePicker.js"></script>
<script type="text/javascript" src="${aier_js_url}jq/cn.js"></script>
<script type="text/javascript" src="${aier_js_url}jq/jq.js"></script>
<script type="text/javascript" src="${aier_js_url}lib/block.js"></script>
<script type="text/javascript" src="${aier_js_url}lib/afu.js"></script>

<script type="text/javascript" src="http://open.web.meitu.com/sources/xiuxiu.js" ></script>
<script type="text/javascript">
window.onload=function(){
	xiuxiu.setLaunchVars("maxFinalWidth", 180);
    xiuxiu.setLaunchVars("maxFinalHeight", 180);
	xiuxiu.embedSWF("altContent",5,"100%","100%");
       /*第1个参数是加载编辑器div容器，第2个参数是编辑器类型，第3个参数是div容器宽，第4个参数是div容器高*/
    
    xiuxiu.setUploadType(2);
    xiuxiu.setUploadDataFieldName("file");
    
	xiuxiu.setUploadURL("${aier_url}${aier_urijs}sbinfo_updateFlashschoolLogo${aier_suffix}");//接收图片接口
	
	xiuxiu.onBeforeUpload = function(data, id){
		xiuxiu.setUploadArgs({photoName: "."+data.type, type: "image",sid:"${sid}"});
	};

	xiuxiu.onInit = function ()
	{
		AvaTemDivP();
		
	};	
	xiuxiu.onUploadResponse = function (data)
	{
		if(1){
			$().message("头像修改成功");
			AvaTemDivP();
		}else{
			$().message("头像修改失败");
		}
		
	};
};


function AvaTemDivP() {
	var fun = function(data) {
		if (!isnull(data.slogo)) {
			$('#crop_preview').attr("src", "${schoollogo_get_url}small/" + data.slogo);
			xiuxiu.loadPhoto( "${schoollogo_get_url}origin/" + data.slogo);
		} else {
			$('#crop_preview').attr("src", "${schoollogo_get_url}small/${school.slogo }");
			xiuxiu.loadPhoto("${schoollogo_get_url}origin/${school.slogo }");
		}

	};
	exeAjax(
			ajaxUrl("${aier_url}${aier_urijs}sbinfo_serachAvatar${aier_suffix}"),
			fun, {
				sid : "${sid}"
			});

}
</script>
</head>


<!-- 设置班徽 -->
<body>



	<!-- 顶栏 -->
	<s:action name="userhomecomm_homeHead" namespace="/user"
		executeResult="true"></s:action>

	<!-- 正文 -->
	<div id="hfContent" class="ar-content">
		<div class="content-main">
			<!-- 学校名称栏 -->
			<s:action name="scomm_schoolMTitle" namespace="/school"
				executeResult="true"></s:action>
			<div class="main-content wrap-bg clearfix">
				<!-- 左侧栏 -->
				<s:action name="scomm_schoolMLeft" namespace="/school"
					executeResult="true"></s:action>
				<!-- 右侧内容 -->
				<div class="ae-right">
					<div class="right-main">
						<div class="right-main-top">
							<div class="binfo-title">
								<span>校徽设置</span>
							</div>
							<div class="right-line"></div>
						</div>
						<div class="right-main-c">
							<div>
								<h6>当前校徽</h6>
								<div style="width: 50px;height: 50px;">
									<img style="width: 100%;height: 100%;" id="crop_preview" alt="" src="">
								</div>
							</div>
							<div style="width: 700px;height: 500px;">
								<div id="altContent">
								</div>
							</div>
							
							<div class="ma-backord">无法上传？请<a href="http://get.adobe.com/cn/flashplayer/" target="_blank">升级flash插件</a>或使用<a href="${aier_url}${aier_uri}sbinfo_schoolLogo${aier_suffix}?sid=${sid}&tid=${tid}">普通上传模式</a></div>
							
						</div>
					</div>
				</div>
			</div>
		</div>
		<!-- footer copyright -->
		<s:action name="userhomecomm_homeFooter" namespace="/user" executeResult="true"></s:action>
		<!-- /footer copyright -->
	</div>

</body>

</html>